﻿module Scenarios



open System.IO
open System.Runtime.Serialization
open Sources
open Tokens
open Keywords
open Steps



[<DataContract>]
type public ScenarioHeader(keyword, description) = 

   [<DataMember>]
   member val Keyword : Token = keyword with get, set
   
   [<DataMember>]
   member val Description : Token = description with get, set
   


//type Scenario = {
//   Header : ScenarioHeader
//   Steps : Step[]
//   }



let ReadScenarioHeader(reader : SourceReader) =
   let keyword = ReadKeyword(reader , Keyword.Scenario)

   if (keyword.IsNone) then
      None
   else
      let description = ReadDescription(reader)
      
      if (description.IsNone) then
         None
      else
         Some(ScenarioHeader(keyword.Value, description.Value))
